import 'package:json_annotation/json_annotation.dart';
import 'package:objectbox/objectbox.dart';
//数据库生成: flutter pub run build_runner build
//定义生成的文件 flutter pub run build_runner build --delete-conflicting-outputs
part 'models_upload_order_task.g.dart';


//上传任务
@JsonSerializable(explicitToJson: true)
@Entity()
class BeanUploadOrderTask {
  @Id()
  int id=0;
  String? uuid;
  String? orderMsg;

  String? functionTypes;//功能类型
  String? orderType;//订单类型,零售,预售,赊销
  String? member;//会员名
  String? phone;//会员电话
  String? shoppingGuide;//导购
  String? cashier;//收银员
  String? orderStatus;//订单状态
  String? orderStatusName;//订单状态
  String? payStatus;//收银状态
  String? payStatusName;//收银状态


  String? typeCode;//传输类型编码 1新增 2支付 3取消 4整单退货
  String? fastOrderNo;  //离线订单号

  String? pushJson;

  //每一笔支付流水list<String>的字符串
  String? payListJson;

  //提交版本号
  String? pushVersion;
  //提交客户端(checkstand智慧收银台,fast_checkstand智慧收银台(极速版),guide_ios 睿本云app苹果,guide_android 睿本云app安卓)|
  String? pushClient;


  bool synSuccess=false;//是否同步成功
  bool businessSuccess=false;//业务是否执行成功

  String? orderId;//api返回

  String? createDate;
  int createDateLong=0;
  String? modifyDate;


  BeanUploadOrderTask(
      {
        this.id=0,
        this.uuid,
        this.orderMsg,
        this.functionTypes,
        this.orderType,
        this.member,
        this.phone,
        this.shoppingGuide,
        this.cashier,
        this.orderStatus,
        this.orderStatusName,
        this.payStatus,
        this.payStatusName,
        this.typeCode,
        this.fastOrderNo,
        this.pushJson,
        this.payListJson,
        this.pushVersion,
        this.pushClient,
        this.synSuccess=false,
        this.businessSuccess=false,
        this.orderId,
        this.createDate,
        this.createDateLong=0,
        this.modifyDate
      }
      ); //添加固定格式
  factory BeanUploadOrderTask.fromJson(Map<String, dynamic> json) => _$BeanUploadOrderTaskFromJson(json);
  Map<String, dynamic> toJson() => _$BeanUploadOrderTaskToJson(this);

}

//上传任务备份
@JsonSerializable(explicitToJson: true)
@Entity()
class BeanUploadOrderTaskBak {
  @Id()
  int id=0;

  int taskId=0;
  String? uuid;
  String? orderMsg;

  String? functionTypes;//功能类型
  String? orderType;//订单类型,零售,预售,赊销
  String? member;//会员名
  String? phone;//会员电话
  String? shoppingGuide;//导购
  String? cashier;//收银员
  String? orderStatus;//订单状态
  String? orderStatusName;//订单状态
  String? payStatus;//收银状态
  String? payStatusName;//收银状态


  String? typeCode;//传输类型编码 1新增 2支付 3取消 4整单退货
  String? fastOrderNo;  //离线订单号

  String? pushJson;

  //每一笔支付流水list<String>的字符串
  String? payListJson;

  //提交版本号
  String? pushVersion;
  //提交客户端(checkstand智慧收银台,fast_checkstand智慧收银台(极速版),guide_ios 睿本云app苹果,guide_android 睿本云app安卓)|
  String? pushClient;


  bool synSuccess=false;//是否同步成功
  bool businessSuccess=false;//业务是否执行成功

  String? orderId;//api返回

  String? createDate;
  int createDateLong=0;
  String? modifyDate;


  BeanUploadOrderTaskBak(
      {
        this.id=0,
        this.taskId=0,
        this.uuid,
        this.orderMsg,
        this.functionTypes,
        this.orderType,
        this.member,
        this.phone,
        this.shoppingGuide,
        this.cashier,
        this.orderStatus,
        this.orderStatusName,
        this.payStatus,
        this.payStatusName,
        this.typeCode,
        this.fastOrderNo,
        this.pushJson,
        this.payListJson,
        this.pushVersion,
        this.pushClient,
        this.synSuccess=false,
        this.businessSuccess=false,
        this.orderId,
        this.createDate,
        this.createDateLong=0,
        this.modifyDate
      }
      ); //添加固定格式
  factory BeanUploadOrderTaskBak.fromJson(Map<String, dynamic> json) => _$BeanUploadOrderTaskBakFromJson(json);
  Map<String, dynamic> toJson() => _$BeanUploadOrderTaskBakToJson(this);

}


//新增订单
@JsonSerializable(explicitToJson: true)
@Entity()
class BeanUploadOrderDetail {
  @Id()
  int id=0;
  String? uuid;
  String? orderMsg;

  String? functionTypes;//功能类型
  String? orderType;//订单类型,零售,预售,赊销
  String? member;//会员名
  String? phone;//会员电话
  String? shoppingGuide;//导购
  String? cashier;//收银员
  String? orderStatus;//订单状态
  String? orderStatusName;//订单状态
  String? payStatus;//收银状态
  String? payStatusName;//收银状态


  String? typeCode;//传输类型编码 1新增 2支付 3取消 4整单退货
  String? fastOrderNo;  //离线订单号

  String? pushJson;

  //每一笔支付流水list<String>的字符串
  String? payListJson;

  //提交版本号
  String? pushVersion;
  //提交客户端(checkstand智慧收银台,fast_checkstand智慧收银台(极速版),guide_ios 睿本云app苹果,guide_android 睿本云app安卓)|
  String? pushClient;


  bool synSuccess=false;//是否同步成功
  bool businessSuccess=false;//业务是否执行成功

  String? orderId;//api返回

  String? createDate;
  int createDateLong=0;
  String? modifyDate;


  BeanUploadOrderDetail(
      {
        this.id=0,
        this.uuid,
        this.orderMsg,
        this.functionTypes,
        this.orderType,
        this.member,
        this.phone,
        this.shoppingGuide,
        this.cashier,
        this.orderStatus,
        this.orderStatusName,
        this.payStatus,
        this.payStatusName,
        this.typeCode,
        this.fastOrderNo,
        this.pushJson,
        this.payListJson,
        this.pushVersion,
        this.pushClient,
        this.synSuccess=false,
        this.businessSuccess=false,
        this.orderId,
        this.createDate,
        this.createDateLong=0,
        this.modifyDate
      }
      ); //添加固定格式
  factory BeanUploadOrderDetail.fromJson(Map<String, dynamic> json) => _$BeanUploadOrderDetailFromJson(json);
  Map<String, dynamic> toJson() => _$BeanUploadOrderDetailToJson(this);

}



//订单记录备份
@JsonSerializable(explicitToJson: true)
@Entity()
class BeanCompleteUploadOrder {
  @Id()
  int id=0;
  String? fastOrderNo;
  String? createDate;
  int createDateLong=0;

  BeanCompleteUploadOrder(
      {
        this.id=0,
        this.fastOrderNo,
        this.createDate,
        this.createDateLong=0,
      }
      ); //添加固定格式
  factory BeanCompleteUploadOrder.fromJson(Map<String, dynamic> json) => _$BeanCompleteUploadOrderFromJson(json);
  Map<String, dynamic> toJson() => _$BeanCompleteUploadOrderToJson(this);

}


//购物车
@JsonSerializable(explicitToJson: true)
@Entity()
class BeanUploadOrderShoppingCart {
  @Id()
  int id=0;
  String? fastOrderNo;
  String? pushJson;
  String? createDate;
  int createDateLong=0;

  BeanUploadOrderShoppingCart(
      {
        this.id=0,
        this.fastOrderNo,
        this.pushJson,
        this.createDate,
        this.createDateLong=0,
      }
      ); //添加固定格式
  factory BeanUploadOrderShoppingCart.fromJson(Map<String, dynamic> json) => _$BeanUploadOrderShoppingCartFromJson(json);
  Map<String, dynamic> toJson() => _$BeanUploadOrderShoppingCartToJson(this);

}
